﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulacion.Fruits
{
    class Banana : Fruit
    {
        private double pLowMi, pLowSigma, pJulMi, pJulSigma, pJulGamma, pHighAlpha, pHighBeta, pHighGamma;

        public Banana()
        {
            _life = 3;
            this.pLowMi = 15.075;
            this.pLowSigma = 3.4308;
            this.pJulMi = 2.1077;
            this.pJulSigma = 0.12514;
            this.pJulGamma = 2.1937;
            this.pHighAlpha = 3648000;
            this.pHighBeta = 12927000;
            this.pHighGamma = -12927000;

            this._pLowMin = 6;
            this._pLowMax = 22;
            this._pHighMin = 16;
            this._pHighMax = 34;
            this._pJulMin = 8.4;
            this._pJulMax = 12.8;
        }

        protected override double GetVarPeriodLow()
        {
            return Distributions.Normal.GetDistributionValue(_pLowMin, _pLowMax, pLowMi, pLowSigma);
        }

        protected override double GetVarPeriodHigh()
        {
            return Distributions.Weibull.GetDistributionValue(_pHighMin, _pHighMax, 29, pHighAlpha, pHighBeta, pHighGamma);
        }

        protected override double GetVarPeriodJuly()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pJulMin, _pJulMax, pJulMi, pJulSigma, pJulGamma);
        }

        protected override double GetFPeriodLow(double x)
        {
            return Distributions.Normal.fNormal(x, pLowMi, pLowSigma);
        }

        protected override double GetFPeriodHigh(double x)
        {
            return Distributions.Weibull.fWeibull(x, 29, pHighAlpha, pHighBeta, pHighGamma);
        }

        protected override double GetFPeriodJuly(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pJulMi, pJulSigma, pJulGamma);
        }

        public double PLowMi
        {
            get { return pLowMi; }
            set { pLowMi = value; }
        }

        public double PLowSigma
        {
            get { return pLowSigma; }
            set { pLowSigma = value; }
        }

        public double PJulMi
        {
            get { return pJulMi; }
            set { pJulMi = value; }
        }

        public double PJulSigma
        {
            get { return pJulSigma; }
            set { pJulSigma = value; }
        }

        public double PJulGamma
        {
            get { return pJulGamma; }
            set { pJulGamma = value; }
        }

        public double PHighAlpha
        {
            get { return pHighAlpha; }
            set { pHighAlpha = value; }
        }

        public double PHighBeta
        {
            get { return pHighBeta; }
            set { pHighBeta = value; }
        }

        public double PHighGamma
        {
            get { return pHighGamma; }
            set { pHighGamma = value; }
        }
    }
}
